Hello and welcome to this select show in this lecture and we will be creating two variables.
One would be to reference the comebacks from javascript and this second will be to stall to day rendering
contex So we use that to render to do graphics on the comebacks before you can actually render graphics
on the canvas.
You need to actually reference a compass with javascript so does what we going to do now is create a
variable to reference the compass.
So this is why fold up the file some going to open that folder and access the javascript.
I'm to go right click hunger or head it saw this as the javascript.
This is where going to quit the variable.
So the first variable I am going to create will be to reference the comebacks so to create a variable
you type in the.
Are full of bind in name you want to give the variable for simplicity.
How core this can.
That's like case and the value of a variable would be of course to document.
Don't get element but a D to what this is saying that the value for lives come by as will be documento
get LMM by a T and that is a reference to a comeback.
Remember when we created the cumbersome we'll give we give the come first and I did value off my comeback.
So let's take a look at that so this is my CML.
Notice here when they come to us was great.
We give it and I devalue off my comforts so this is what we are going to give to Javascript to reference
to Compass.
Let's flip back to the javascript so the name is Mike come that's.
Always surround the values in quotes.
My comebacks.
The value of the idea must be in the exact way it was specified.
If I go back to my index notice I've called in my -- that's so I must specify the same way.
If not a javascript can't reference it so I have created a variable that will reference the comebacks.
So this is canvas variable here.
The value will be equal to B I d off the compass.
I have created N which is my canvas.
Now that would create the kind that's going to create on another variable that would be used
to store to d rendering context so the variable records S.T. X which is short for context and the value
of that variable will be variable.
Here a creative call come about which will become of us.
Dont get the context.
So they get context is C is an object in javascript that refused to access or do stuff on the compass
so it takes one value and the value is too deep.
All right.
I'm thinkin that.
I always put the semicolon at the end of your variables when you created them.
So the first variable here access this become bus.
The second variable here which is this context here.
What this will do it will store any to the rendering would do to come.
So any drawing any stuff we do on cover as it will store that value inside is variable.
Okay so this this here is responsible for any drawing or painting that is done on the compass.
It will be stored use in this variable so just sit for this lecture in the next lecture.
We will be drawn in on the combat's.
Take care.
Bye for now.